libostree: Make OstreeBootloader private
authorColin Walters <walters@verbum.org>
Mon, 16 Sep 2013 00:26:13 +0000 (20:26 -0400)
committerColin Walters <walters@verbum.org>
Mon, 16 Sep 2013 00:26:13 +0000 (20:26 -0400)
It was only temporarily public while functionality was being merged
down; that's done now.

12 files changed:
Makefile-libostree-defines.am
Makefile-libostree.am
src/libostree/ostree-bootloader-syslinux.c
src/libostree/ostree-bootloader-syslinux.h
src/libostree/ostree-bootloader-uboot.c
src/libostree/ostree-bootloader-uboot.h
src/libostree/ostree-bootloader.c
src/libostree/ostree-bootloader.h
src/libostree/ostree-sysroot-deploy.c
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c
src/libostree/ostree-sysroot.h

index da4507f30923d62a7ee6ce4c9b7188144df21645..4be0eeca2b4509a11610dff14701dca00a03d208 100644 (file)
@@ -27,7 +27,6 @@ libostree_public_headers = \
        src/libostree/ostree-repo-file.h \
        src/libostree/ostree-diff.h \
        src/libostree/ostree-sysroot.h \
-       src/libostree/ostree-bootloader.h \
        src/libostree/ostree-deployment.h \
        src/libostree/ostree-bootconfig-parser.h \
        $(NULL)
index d9ee1f1051f79894f17dce0c1b2ae6de41d33d74..7925a26d70649ce8fe1d2905a8bd4e4b28d91350 100644 (file)
@@ -49,6 +49,7 @@ libostree_1_la_SOURCES = \
        src/libostree/ostree-sysroot-deploy.c \
        src/libostree/ostree-bootconfig-parser.c \
        src/libostree/ostree-deployment.c \
+       src/libostree/ostree-bootloader.h \
        src/libostree/ostree-bootloader.c \
        src/libostree/ostree-bootloader-syslinux.h \
        src/libostree/ostree-bootloader-syslinux.c \
index 9c6b221991cbf3880b85d16ddd89583c05bf9bbb..de9983bb667a788b1091146c9b3bf71cff858865 100644 (file)
@@ -37,12 +37,12 @@ struct _OstreeBootloaderSyslinux
 
 typedef GObjectClass OstreeBootloaderSyslinuxClass;
 
-static void ostree_bootloader_syslinux_bootloader_iface_init (OstreeBootloaderInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (OstreeBootloaderSyslinux, ostree_bootloader_syslinux, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (OSTREE_TYPE_BOOTLOADER, ostree_bootloader_syslinux_bootloader_iface_init));
+static void _ostree_bootloader_syslinux_bootloader_iface_init (OstreeBootloaderInterface *iface);
+G_DEFINE_TYPE_WITH_CODE (OstreeBootloaderSyslinux, _ostree_bootloader_syslinux, G_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE (OSTREE_TYPE_BOOTLOADER, _ostree_bootloader_syslinux_bootloader_iface_init));
 
 static gboolean
-ostree_bootloader_syslinux_query (OstreeBootloader *bootloader)
+_ostree_bootloader_syslinux_query (OstreeBootloader *bootloader)
 {
   OstreeBootloaderSyslinux *self = OSTREE_BOOTLOADER_SYSLINUX (bootloader);
 
@@ -50,7 +50,7 @@ ostree_bootloader_syslinux_query (OstreeBootloader *bootloader)
 }
 
 static const char *
-ostree_bootloader_syslinux_get_name (OstreeBootloader *bootloader)
+_ostree_bootloader_syslinux_get_name (OstreeBootloader *bootloader)
 {
   return "syslinux";
 }
@@ -111,7 +111,7 @@ append_config_from_boostree_loader_entries (OstreeBootloaderSyslinux  *self,
 }
 
 static gboolean
-ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
+_ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
                                      int                    bootversion,
                                      GCancellable          *cancellable,
                                      GError               **error)
@@ -254,39 +254,39 @@ ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
 }
 
 static void
-ostree_bootloader_syslinux_finalize (GObject *object)
+_ostree_bootloader_syslinux_finalize (GObject *object)
 {
   OstreeBootloaderSyslinux *self = OSTREE_BOOTLOADER_SYSLINUX (object);
 
   g_clear_object (&self->sysroot);
   g_clear_object (&self->config_path);
 
-  G_OBJECT_CLASS (ostree_bootloader_syslinux_parent_class)->finalize (object);
+  G_OBJECT_CLASS (_ostree_bootloader_syslinux_parent_class)->finalize (object);
 }
 
 void
-ostree_bootloader_syslinux_init (OstreeBootloaderSyslinux *self)
+_ostree_bootloader_syslinux_init (OstreeBootloaderSyslinux *self)
 {
 }
 
 static void
-ostree_bootloader_syslinux_bootloader_iface_init (OstreeBootloaderInterface *iface)
+_ostree_bootloader_syslinux_bootloader_iface_init (OstreeBootloaderInterface *iface)
 {
-  iface->query = ostree_bootloader_syslinux_query;
-  iface->get_name = ostree_bootloader_syslinux_get_name;
-  iface->write_config = ostree_bootloader_syslinux_write_config;
+  iface->query = _ostree_bootloader_syslinux_query;
+  iface->get_name = _ostree_bootloader_syslinux_get_name;
+  iface->write_config = _ostree_bootloader_syslinux_write_config;
 }
 
 void
-ostree_bootloader_syslinux_class_init (OstreeBootloaderSyslinuxClass *class)
+_ostree_bootloader_syslinux_class_init (OstreeBootloaderSyslinuxClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-  object_class->finalize = ostree_bootloader_syslinux_finalize;
+  object_class->finalize = _ostree_bootloader_syslinux_finalize;
 }
 
 OstreeBootloaderSyslinux *
-ostree_bootloader_syslinux_new (OstreeSysroot *sysroot)
+_ostree_bootloader_syslinux_new (OstreeSysroot *sysroot)
 {
   OstreeBootloaderSyslinux *self = g_object_new (OSTREE_TYPE_BOOTLOADER_SYSLINUX, NULL);
   self->sysroot = g_object_ref (sysroot);
index 7f4481682b0ea51dd04f6a66d5ea896bbfa7f957..1023bbef201b043d0dbdb7b84ce7b85377251f60 100644 (file)
 
 G_BEGIN_DECLS
 
-#define OSTREE_TYPE_BOOTLOADER_SYSLINUX (ostree_bootloader_syslinux_get_type ())
+#define OSTREE_TYPE_BOOTLOADER_SYSLINUX (_ostree_bootloader_syslinux_get_type ())
 #define OSTREE_BOOTLOADER_SYSLINUX(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), OSTREE_TYPE_BOOTLOADER_SYSLINUX, OstreeBootloaderSyslinux))
 #define OSTREE_IS_BOOTLOADER_SYSLINUX(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), OSTREE_TYPE_BOOTLOADER_SYSLINUX))
 
 typedef struct _OstreeBootloaderSyslinux OstreeBootloaderSyslinux;
 
-GType ostree_bootloader_syslinux_get_type (void) G_GNUC_CONST;
+GType _ostree_bootloader_syslinux_get_type (void) G_GNUC_CONST;
 
-OstreeBootloaderSyslinux * ostree_bootloader_syslinux_new (OstreeSysroot *sysroot);
+OstreeBootloaderSyslinux * _ostree_bootloader_syslinux_new (OstreeSysroot *sysroot);
 
 G_END_DECLS
 
index 5d711ef72243fe62e199ea92460fed509f51778b..2eb4eb6ecc8e2c8f32ce5b9f204e9d50e915fdd8 100644 (file)
@@ -41,12 +41,12 @@ struct _OstreeBootloaderUboot
 
 typedef GObjectClass OstreeBootloaderUbootClass;
 
-static void ostree_bootloader_uboot_bootloader_iface_init (OstreeBootloaderInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (OstreeBootloaderUboot, ostree_bootloader_uboot, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (OSTREE_TYPE_BOOTLOADER, ostree_bootloader_uboot_bootloader_iface_init));
+static void _ostree_bootloader_uboot_bootloader_iface_init (OstreeBootloaderInterface *iface);
+G_DEFINE_TYPE_WITH_CODE (OstreeBootloaderUboot, _ostree_bootloader_uboot, G_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE (OSTREE_TYPE_BOOTLOADER, _ostree_bootloader_uboot_bootloader_iface_init));
 
 static gboolean
-ostree_bootloader_uboot_query (OstreeBootloader *bootloader)
+_ostree_bootloader_uboot_query (OstreeBootloader *bootloader)
 {
   OstreeBootloaderUboot *self = OSTREE_BOOTLOADER_UBOOT (bootloader);
 
@@ -54,7 +54,7 @@ ostree_bootloader_uboot_query (OstreeBootloader *bootloader)
 }
 
 static const char *
-ostree_bootloader_uboot_get_name (OstreeBootloader *bootloader)
+_ostree_bootloader_uboot_get_name (OstreeBootloader *bootloader)
 {
   return "U-Boot";
 }
@@ -98,7 +98,7 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot     *self,
 }
 
 static gboolean
-ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
+_ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
                                   int                    bootversion,
                                   GCancellable          *cancellable,
                                   GError               **error)
@@ -139,39 +139,39 @@ ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
 }
 
 static void
-ostree_bootloader_uboot_finalize (GObject *object)
+_ostree_bootloader_uboot_finalize (GObject *object)
 {
   OstreeBootloaderUboot *self = OSTREE_BOOTLOADER_UBOOT (object);
 
   g_clear_object (&self->sysroot);
   g_clear_object (&self->config_path);
 
-  G_OBJECT_CLASS (ostree_bootloader_uboot_parent_class)->finalize (object);
+  G_OBJECT_CLASS (_ostree_bootloader_uboot_parent_class)->finalize (object);
 }
 
 void
-ostree_bootloader_uboot_init (OstreeBootloaderUboot *self)
+_ostree_bootloader_uboot_init (OstreeBootloaderUboot *self)
 {
 }
 
 static void
-ostree_bootloader_uboot_bootloader_iface_init (OstreeBootloaderInterface *iface)
+_ostree_bootloader_uboot_bootloader_iface_init (OstreeBootloaderInterface *iface)
 {
-  iface->query = ostree_bootloader_uboot_query;
-  iface->get_name = ostree_bootloader_uboot_get_name;
-  iface->write_config = ostree_bootloader_uboot_write_config;
+  iface->query = _ostree_bootloader_uboot_query;
+  iface->get_name = _ostree_bootloader_uboot_get_name;
+  iface->write_config = _ostree_bootloader_uboot_write_config;
 }
 
 void
-ostree_bootloader_uboot_class_init (OstreeBootloaderUbootClass *class)
+_ostree_bootloader_uboot_class_init (OstreeBootloaderUbootClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-  object_class->finalize = ostree_bootloader_uboot_finalize;
+  object_class->finalize = _ostree_bootloader_uboot_finalize;
 }
 
 OstreeBootloaderUboot *
-ostree_bootloader_uboot_new (OstreeSysroot *sysroot)
+_ostree_bootloader_uboot_new (OstreeSysroot *sysroot)
 {
   OstreeBootloaderUboot *self = g_object_new (OSTREE_TYPE_BOOTLOADER_UBOOT, NULL);
   self->sysroot = g_object_ref (sysroot);
index 4b196083a690300a46990e423a7a8e4f2380817c..da811897059edda3510aa703a093c214d3096514 100644 (file)
 
 G_BEGIN_DECLS
 
-#define OSTREE_TYPE_BOOTLOADER_UBOOT (ostree_bootloader_uboot_get_type ())
+#define OSTREE_TYPE_BOOTLOADER_UBOOT (_ostree_bootloader_uboot_get_type ())
 #define OSTREE_BOOTLOADER_UBOOT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), OSTREE_TYPE_BOOTLOADER_UBOOT, OstreeBootloaderUboot))
 #define OSTREE_IS_BOOTLOADER_UBOOT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), OSTREE_TYPE_BOOTLOADER_UBOOT))
 
 typedef struct _OstreeBootloaderUboot OstreeBootloaderUboot;
 
-GType ostree_bootloader_uboot_get_type (void) G_GNUC_CONST;
+GType _ostree_bootloader_uboot_get_type (void) G_GNUC_CONST;
 
-OstreeBootloaderUboot * ostree_bootloader_uboot_new (OstreeSysroot *sysroot);
+OstreeBootloaderUboot * _ostree_bootloader_uboot_new (OstreeSysroot *sysroot);
 
 G_END_DECLS
index 2438013404b55a70f6f7012d16652079c20a5fcf..5cb7c5ea0b4c0e7c885b9c92f2a9ed97c19d6a5a 100644 (file)
 #include "ostree-bootloader.h"
 #include "libgsystem.h"
 
-G_DEFINE_INTERFACE (OstreeBootloader, ostree_bootloader, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (OstreeBootloader, _ostree_bootloader, G_TYPE_OBJECT)
 
 static void
-ostree_bootloader_default_init (OstreeBootloaderInterface *iface)
+_ostree_bootloader_default_init (OstreeBootloaderInterface *iface)
 {
 }
 
 gboolean
-ostree_bootloader_query (OstreeBootloader  *self)
+_ostree_bootloader_query (OstreeBootloader  *self)
 {
   g_return_val_if_fail (OSTREE_IS_BOOTLOADER (self), FALSE);
 
@@ -38,12 +38,12 @@ ostree_bootloader_query (OstreeBootloader  *self)
 }
 
 /**
- * ostree_bootloader_get_name:
+ * _ostree_bootloader_get_name:
  *
  * Returns: (transfer none): Name of this bootloader
  */
 const char *
-ostree_bootloader_get_name (OstreeBootloader  *self)
+_ostree_bootloader_get_name (OstreeBootloader  *self)
 {
   g_return_val_if_fail (OSTREE_IS_BOOTLOADER (self), NULL);
 
@@ -51,7 +51,7 @@ ostree_bootloader_get_name (OstreeBootloader  *self)
 }
 
 gboolean
-ostree_bootloader_write_config (OstreeBootloader  *self,
+_ostree_bootloader_write_config (OstreeBootloader  *self,
                             int            bootversion,
                             GCancellable  *cancellable,
                             GError       **error)
index 6784409f83d6864087727473d8e6f64f087b38f6..0d07fdba2afbea2d1b96e31b9229def3ec00f57e 100644 (file)
@@ -24,7 +24,7 @@
 
 G_BEGIN_DECLS
 
-#define OSTREE_TYPE_BOOTLOADER (ostree_bootloader_get_type ())
+#define OSTREE_TYPE_BOOTLOADER (_ostree_bootloader_get_type ())
 #define OSTREE_BOOTLOADER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), OSTREE_TYPE_BOOTLOADER, OstreeBootloader))
 #define OSTREE_IS_BOOTLOADER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), OSTREE_TYPE_BOOTLOADER))
 #define OSTREE_BOOTLOADER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), OSTREE_TYPE_BOOTLOADER, OstreeBootloaderInterface))
@@ -45,16 +45,16 @@ struct _OstreeBootloaderInterface
                                                    GError       **error);
 };
 
-GType ostree_bootloader_get_type (void) G_GNUC_CONST;
+GType _ostree_bootloader_get_type (void) G_GNUC_CONST;
 
-gboolean ostree_bootloader_query (OstreeBootloader *self);
+gboolean _ostree_bootloader_query (OstreeBootloader *self);
 
-const char *ostree_bootloader_get_name (OstreeBootloader  *self);
+const char *_ostree_bootloader_get_name (OstreeBootloader  *self);
 
-gboolean ostree_bootloader_write_config (OstreeBootloader  *self,
-                                         int            bootversion,
-                                         GCancellable  *cancellable,
-                                         GError       **error);
+gboolean _ostree_bootloader_write_config (OstreeBootloader  *self,
+                                          int            bootversion,
+                                          GCancellable  *cancellable,
+                                          GError       **error);
 
 G_END_DECLS
 
index 2b3e853a60b0a051929c0e7aefa1ac979ac93fd1..38e182c39439a29530d8c435874b8049ccd1544e 100644 (file)
@@ -992,10 +992,10 @@ ostree_sysroot_write_deployments (OstreeSysroot     *sysroot,
 {
   gboolean ret = FALSE;
   guint i;
-  gs_unref_object OstreeBootloader *bootloader = ostree_sysroot_query_bootloader (sysroot);
+  gs_unref_object OstreeBootloader *bootloader = _ostree_sysroot_query_bootloader (sysroot);
 
   if (bootloader)
-    g_print ("Detected bootloader: %s\n", ostree_bootloader_get_name (bootloader));
+    g_print ("Detected bootloader: %s\n", _ostree_bootloader_get_name (bootloader));
   else
     g_print ("Detected bootloader: (unknown)\n");
 
@@ -1043,8 +1043,8 @@ ostree_sysroot_write_deployments (OstreeSysroot     *sysroot,
           goto out;
         }
 
-      if (bootloader && !ostree_bootloader_write_config (bootloader, new_bootversion,
-                                                         cancellable, error))
+      if (bootloader && !_ostree_bootloader_write_config (bootloader, new_bootversion,
+                                                          cancellable, error))
           {
             g_prefix_error (error, "Bootloader write config: ");
             goto out;
index f8b6d10c8f642029111b99d5bf1e0343bcf11348..f51b2bb8480b866c84faa9d84a048d8cf98d38f9 100644 (file)
@@ -60,5 +60,7 @@ OstreeOrderedHash *_ostree_sysroot_parse_kernel_args (const char *options);
 
 char * _ostree_sysroot_kernel_arg_string_serialize (OstreeOrderedHash *ohash);
 
+OstreeBootloader *_ostree_sysroot_query_bootloader (OstreeSysroot         *sysroot);
+
 G_END_DECLS
 
index 464a42d706882cb1030284d4d9654f8cb36e179f..20b266d04977cd3a7cd9f5b671d7c14f6edd029c 100644 (file)
@@ -800,17 +800,17 @@ ostree_sysroot_get_repo (OstreeSysroot         *self,
  * Returns: (transfer full): Currently active bootloader in @sysroot
  */
 OstreeBootloader *
-ostree_sysroot_query_bootloader (OstreeSysroot *self)
+_ostree_sysroot_query_bootloader (OstreeSysroot *self)
 {
   OstreeBootloaderSyslinux *syslinux;
   OstreeBootloaderUboot    *uboot;
 
-  syslinux = ostree_bootloader_syslinux_new (self);
-  if (ostree_bootloader_query ((OstreeBootloader*)syslinux))
+  syslinux = _ostree_bootloader_syslinux_new (self);
+  if (_ostree_bootloader_query ((OstreeBootloader*)syslinux))
     return (OstreeBootloader*) (syslinux);
 
-  uboot = ostree_bootloader_uboot_new (self);
-  if (ostree_bootloader_query ((OstreeBootloader*)uboot))
+  uboot = _ostree_bootloader_uboot_new (self);
+  if (_ostree_bootloader_query ((OstreeBootloader*)uboot))
     return (OstreeBootloader*) (uboot);
 
   return NULL;
index 2227a638389f5c7829c2412e0b9b946a7c5bc2c2..09db3785d801f2274cb097ab43fe853795d506b1 100644 (file)
@@ -70,8 +70,6 @@ gboolean ostree_sysroot_get_repo (OstreeSysroot         *self,
                                   GCancellable          *cancellable,
                                   GError               **error);
 
-OstreeBootloader *ostree_sysroot_query_bootloader (OstreeSysroot         *sysroot);
-
 
 gboolean ostree_sysroot_find_booted_deployment (OstreeSysroot       *sysroot,
                                                 GPtrArray           *deployments,